﻿using System.Reflection;

namespace WMS.FC.Domain.DomainObject.System
{
    public class SplitTableEntityInfo
    {
        /// <summary>
        /// 表信息
        /// </summary>
        public SplitTableAttribute SplitTable { get; set; }

        /// <summary>
        /// 主键属性名
        /// </summary>
        public string Key { get; set; } = string.Empty;

        /// <summary>
        /// 主键列信息
        /// </summary>
        public SplitTableColumnAttribute KeyColumnInfo { get; set; } = new SplitTableColumnAttribute();

        /// <summary>
        /// 列信息
        /// </summary>
        public Dictionary<string, SplitTableColumnAttribute> ColumnList { get; set; } = new Dictionary<string, SplitTableColumnAttribute>();

        /// <summary>
        /// 属性信息
        /// </summary>
        public Dictionary<string, PropertyInfo> PropertyList { get; set; } = new Dictionary<string, PropertyInfo>();

        /// <summary>
        /// 索引信息
        /// </summary>
        public List<SplitTableIndexAttribute> IndexList = new List<SplitTableIndexAttribute>();

        /// <summary>
        /// 表名映射
        /// </summary>
        public Dictionary<DateTime, string> SplitTableNames = new Dictionary<DateTime, string>();

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="splitTable"></param>
        public SplitTableEntityInfo(SplitTableAttribute splitTable)
        {
            SplitTable = splitTable;
        }
    }
}
